package chpt08;

import java.io.PipedInputStream;
import java.io.PipedOutputStream;
public class SimpleComm {
	public static void main(String[] args){
        new SimpleComm();
	}
    public SimpleComm(){
        try{
			PipedOutputStream out = new PipedOutputStream();
			PipedInputStream in = new PipedInputStream(out);           
            Thread receiver = new Thread(new Receiver(in));
            Thread sender = new Thread(new Sender(out));
            receiver.start();
            sender.start();
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
